//
//  YYJLVideoCommentController.m
//  YuanyangJinlou
//
//  Created by mac004 on 2017/1/10.
//  Copyright © 2017年 suli19910309@qq.com. All rights reserved.
//  视频评论信息

#import "YYJLVideoCommentController.h"
#import "YYJLCommentCell.h"
@interface YYJLVideoCommentController ()<UITableViewDataSource,UITableViewDelegate>{
    UITableView * _tableView;
}

@end

@implementation YYJLVideoCommentController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
   // self.view .backgroundColor=[UIColor redColor];
    _tableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-250*PER_HEIGHT-44*PER_HEIGHT-61*PER_HEIGHT-64) style:UITableViewStylePlain];
    _tableView.backgroundColor=[UIColor whiteColor];
    _tableView.dataSource=self;
    _tableView.delegate=self;
    _tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
    _tableView.tableHeaderView=[self addHeaderView];
    [self.view addSubview:_tableView];
}
#pragma mark--tableView
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row==0) {
        return 250*PER_HEIGHT;
    }
    else {
        return 100*PER_HEIGHT;
    }
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    YYJLCommentCell* cell=[tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell =[[YYJLCommentCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    if (indexPath.row==0) {
        cell.isReplace=YES;
    }else{
        cell.isReplace=NO;
    }
    return cell;
}
-(UIView*)addHeaderView{
    UIView*view=[[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 44*PER_HEIGHT)];
    view.backgroundColor=WHITE_COLOR;
    
    UILabel* lab =[MyControl createLabelWithFrame:CGRectMake(12*PER_WIDTH, 15*PER_HEIGHT, SCREEN_WIDTH-24*PER_WIDTH, 15*PER_HEIGHT) Font:15 Text:@"全部评论" Color:BLACK_COLOR];
    [view addSubview:lab];
    UIView * line =[[UIView alloc]initWithFrame:CGRectMake(0, view.height-0.5, SCREEN_WIDTH, 0.5)];
    line.backgroundColor=UIColorFromHex(0xcccccc);
    [view addSubview:line];
    
    return view;

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
